from django import forms

from browsertests.common.forms import CommonSearchForm
# XXX maybe move flag/tag/spec filtering to CommonSearchForm
from browsertests.tests.models import Flag, Tag
from browsertests.specs.models import Spec, Section

class TestSearchForm(CommonSearchForm):
    flag = forms.MultipleChoiceField(choices=[(f.pk, str(f)) for f in Flag.objects.all()],
                                     required=False, widget=forms.SelectMultiple(attrs={"size":5}))
    tag = forms.MultipleChoiceField(choices=[(t.pk, str(t)) for t in Tag.objects.all()],
                                    required=False, widget=forms.SelectMultiple(attrs={"size":5}))
    spec = forms.MultipleChoiceField(choices=[(s.pk, str(s)) for s in Spec.objects.all()],
                                     required=False, widget=forms.SelectMultiple(attrs={"size":5}))
    #section = forms.MultipleChoiceField(choices=[(s.pk, str(s)) for s in Section.objects.all()],
    #                                    required=False, widget=forms.SelectMultiple(attrs={"size":5}))
    #section = forms.MultipleChoiceField(required=False, widget=forms.HiddenInput())
